package org.xdq;

import javax.naming.Name;

public class Main {

    public static void main(String[] args) {
	   Thread T0 = Thread.currentThread();//获取当前线程对象

        Thread t1 = new One("one");

        Thread t2 = new Thread(new Two(),"two");

        t1.start();//将被调用的线程，放在线程池中，jvm对线程池中的线程平等对待,处于就绪状态
        t2.start();

        System.out.println("主线程"+T0.getName());
                for (int i=0;i<100;i++){
        System.out.println(T0.getName()+","+i);
//            try {
//                Thread.sleep(100);//当前线程睡梦1000
//            } catch (InterruptedException e) {
//                e.printStackTrace();
//            }
        }
        System.out.println("主线程结束！");
        }
        }
